<template>
  <div class="container" style="width:98%; margin-left: auto ;margin-right: auto;">
    <!-- 顶部 -->
    <topBar />
    <el-container>
      <!-- 侧边菜单栏  -->
      <navigation style="margin-top:7px;background-color: #f2f6fc;" />
      <el-main :style="defaultHeight"><router-view></router-view></el-main>
    </el-container>
  </div>
</template>

<script>
import topBar from "../../components/administrator/home/adminTopBar";
import navigation from "../../components/administrator/home/adminNavigation";
export default {
  name: "adminHome",
  components: { topBar, navigation },
  data() {
    return {
      defaultHeight: {
        height: "",
      },
    };
  },
  methods: {
    //定义方法，获取高度减去头尾
    getHeight() {
      this.defaultHeight.height = window.innerHeight - 90 + "px";
    },
  },
  created() {
    //页面创建时执行一次getHeight进行赋值，顺道绑定resize事件
    window.addEventListener("resize", this.getHeight);
    this.getHeight();
  },
};
</script>

<style lang="less" scoped></style>
